home *** CD-ROM | disk | FTP | other *** search
- library Dbldll;
-
- uses
- WinProcs;
-
- {$define MSCOMPATIBILITY}
- {$ifndef MSCOMPATIBILITY}
- function TestFloatPascal(D: Double): Double; export;
- begin
- Result := D;
- end;
-
- function TestFloatCDecl(D: Double): Double; cdecl; export;
- begin
- Result := D;
- end;
- {$else}
- type
- PDouble = ^Double;
-
- var
- __fac: Double; { Global variable for flops (floating point operations) }
-
- function TestFloatPascal(D: Double; Offset: Word): PDouble; export;
- begin
- Result := Ptr(SSeg, Offset); { Return address of result on stack }
- Result^ := D; { Store result in stack at given offset }
- end;
-
- { If the parameter is an Extended (long double), this change won't }
- { be necessary - MSC returns it in the same way as Delphi - on the NDP stack}
- function TestFloatCDecl(D: Double): PDouble; cdecl; export;
- begin
- Result := @__fac; { Return address of result in DLL data segment }
- Result^ := D; { Store result in DLL variable }
- end;
- {$endif}
-
- exports
- TestFloatPascal index 2,
- TestFloatCDecl index 3;
-
- begin
- end.
-